package com.example.wifiunlockscreen.listeners;

import com.example.wifiunlockscreen.support.WifiFriendObject;
import com.example.wifiunlockscreen.support.WifiInfoManager;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

public class CLickDeleteWifiFriend implements OnClickListener {

	WifiFriendObject wifiFriend;
	WifiInfoManager wifiInfoManager;
	
	public CLickDeleteWifiFriend(WifiFriendObject wifi, WifiInfoManager wifiManager){
		this.wifiFriend = wifi;
		this.wifiInfoManager = wifiManager;
	}
	
	@Override
	public void onClick(View view) {
		Toast mensaje = new Toast(view.getContext());
		//mensaje.makeText(view.getContext(),"Voy a borrar la wifi con id: "+wifiFriend.getId(), Toast.LENGTH_SHORT).show();
		
		Boolean result = wifiInfoManager.deleteFriend(wifiFriend);
		
		if(result){
			//TODO Actualizar lista
		}else{
			//mensaje.makeText(view.getContext(),"Wifi Borrada", Toast.LENGTH_SHORT).show();
		}
		
	}

}
